package home.xyx.hw02727;

import java.util.Scanner;

public class TestHomework0727 {

	public static void main(String[] args) {
		//汽车品牌
		//VehicleTest();
		//计算圆矩形周长
		//PolyDemo();
		//计算工资
		//TestCompany();
		test04();
		//test05();
	}
	public static void VehicleTest() {
		Vehicle car1=new Vehicle("benz","black");
		
		Car car2=new Car("Honda","red",100);
		car2.run();
	}
	public static void PolyDemo() {
		//多态的方式父类的类型指向子类的实例化
		//矩形
		Shape Rectangle=new Rectangle("yellow",200,300);
/*		Rectangle.getArea();
		Rectangle.getPer();*/
		Rectangle.showAll();
		//圆形
		Shape Circle   =new Circle("red",20);
/*		Circle.getArea();
		Circle.getPer();*/
		Circle.showAll();
	}
	public static void TestCompany() {
		ColaEmployee[] ColaEmployee =new ColaEmployee [3];
		//固定工资的实例对象      姓名，生日月份，
		ColaEmployee [0]=new SalariedEmployee("张三",2);
		ColaEmployee[0].printMoney();
		//小时工资的实例对象    姓名，生日月份，工作小时
		ColaEmployee [1]=new HourlyEmployee("李四",3,170);
		ColaEmployee[1].printMoney();
		//销售额的实例对象     姓名，生日月份，销售额， 提取率
		ColaEmployee [2]=new SalesEmployee("王五",2,10,0.6);
		ColaEmployee[2].printMoney();
		
		
	}
	public static void test04() {
		Gardener gar=new Gardener();
		Scanner sc=new Scanner(System.in);
		String sr =sc.next();
		if(sr.equals("苹果")) {
			gar.create(new Apple(3));
		}else if (sr.equals("香蕉")) {
			gar.create(new Banana(3));
		}else{
			gar.create(new Grape(3));
		}
	}
	public static void test05() {
		Manager ma=new Manager();
		ma.init();
		ma.printAllthe();
		
		
	}
}

